from django.shortcuts import render
from rest_framework import viewsets, permissions
from .models import DiagnosisTemplate
from .serializers import DiagnosisTemplateSerializer

# Create your views here.

class DiagnosisTemplateViewSet(viewsets.ModelViewSet):
    """诊断模板视图集"""
    queryset = DiagnosisTemplate.objects.filter(is_active=True)
    serializer_class = DiagnosisTemplateSerializer
    permission_classes = [permissions.IsAuthenticated]
    filterset_fields = ['name']
    search_fields = ['name', 'description']
    ordering_fields = ['created_at', 'updated_at']
